﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                assembly="KuaJing.Security"
				        namespace="KuaJing.Security.Domain">

  <class name="RolePermission" table="Security_RolePermission">
    <id name="Id" access="field.camelcase"
        column="RolePermissionId" type="Int32">
      <generator class="native" />
    </id>
    <version name="Version" access="field.camelcase" />
    <many-to-one name="Role" column="RoleId" foreign-key="fk_RolePermission_Role"
               class="KuaJing.Security.Domain.Role,KuaJing.Security" cascade="none"/>

    <many-to-one name="Privilege" column="PrivilegeId" foreign-key="fk_RolePermission_Privilege"
              class="KuaJing.Security.Domain.Privilege,KuaJing.Security" cascade="none"/>
    
    <!--<set name="Privileges" cascade="all" inverse="false">
      <key column="RolePermissionId" foreign-key="fk_RolePermission_Privilege"></key>
      <one-to-many class="KuaJing.Security.Domain.Privilege,KuaJing.Security" column="PrivilegeId" />
    </set>-->
    <property name="CreatedTime" access="field.camelcase" />
    <property name="CreatedUserName" access="field.camelcase" />
    <property name="ModifiedTime" access="field.camelcase" />
    <property name="ModifiedUserName" access="field.camelcase" />
    <property name="AccessedTime" access="field.camelcase" />
    <property name="AccessedUserName" access="field.camelcase" />
    <property name="Memo" />
    <property name="IsInvalid" />
  </class>
</hibernate-mapping>
